import os
import imageio.v2 as imageio
from PIL import Image

# 合并 gif
images = []
numberlist = os.listdir('D:/tmp')
for i in range(len(numberlist)):
    images.append(imageio.imread('D:/tmp/'+numberlist[i]))

# 图像被压制了。。
imageio.mimsave("新动图.gif", images, duration=0.1, loop=0)   # 转化为gif动